
package com.xifan.myaccount.entity;

public class TypeStats implements Comparable<TypeStats> {
    private int typeId;
    private String typeName;
    private float typeMoney;
    private int percentage;

    public int getTypeId() {
        return typeId;
    }

    public void setTypeId(int typeId) {
        this.typeId = typeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public float getTypeMoney() {
        return typeMoney;
    }

    public void setTypeMoney(float typeMoney) {
        this.typeMoney = typeMoney;
    }

    public int getPercentage() {
        return percentage;
    }

    public void setPercentage(int percentage) {
        this.percentage = percentage;
    }

    public int compareTo(TypeStats another) {
        if (typeMoney > another.getTypeMoney()) {
            return -1;
        } else if (typeMoney == another.getTypeMoney()) {
            return 0;
        } else {
            return 1;
        }
    }
}
